package day_2022_7_to_8.day48;

/**
 * @author haomin
 * @date 2022/08/18 11:43
 **/
public class Day33_3_Num65_IsNumber {
    class Solution {
        public boolean isNumber(String s) {
            s = s.trim();
            try{
                Double.valueOf(s);
                if(s.charAt(s.length() - 1) == 'f' || s.charAt(s.length() - 1) == 'D' || s.charAt(s.length() -1) == 'y') {
                    return false;
                }
                return true;
            } catch (Exception e) {
                return false;
            }
        }
    }
    // 正则表达式
    //return s.matches("^[+-]?((\\d+)|(\\d+\\.\\d*)|(\\d*\\.\\d+))([eE][+-]?\\d+)?$");
}